import Vue from 'vue'
import Vuex from 'vuex'
import $ from 'jquery'
Vue.use(Vuex)

export default new Vuex.Store({
    state:{
        homeImage: null,
        apiUrl: '/api'
    },
    actions: {
        interAcess(context){
           $.ajax({
               type: 'get',
               url:  context.state.apiUrl + '/ads',
               dataType: 'json',
               success: (res) => {
                   context.state.homeImage = res.data
               }
           })
        }
    }
})